digit_train = load('digit_train.data');
digit = load('digit.data');
digit_test = load('digit_test.data');

digit_train_meas =  digit_train(:, 1:size(digit_train, 2)-1);
digit_train_out = digit_train(:, size(digit_train, 2));

digit_train_meas_meass = sparse(digit_train_meas);

digit_meas =  digit(:, 1:size(digit, 2)-1);
digit_out = digit(:, size(digit, 2));

digit_meass = sparse(digit_meas);

digit_test_meas =  digit_test(:, 1:size(digit_test, 2)-1);
digit_test_out = digit_test(:, size(digit_test, 2));

digit_test_meass = sparse(digit_test_meas);

model = train(digit_train_out, digit_train_meas_meass, '-s 4');

disp('----------------------------')
disp('PREDICT dla digit_train.data:')
[l,a]=predict(digit_train_out, digit_train_meas_meass, model);
disp('----------------------------')
disp('PREDICT dla digit.data:')
[l,a]=predict(digit_out, digit_meass, model);
disp('----------------------------')
disp('PREDICT dla digit_test.data:')
[l,a]=predict(digit_test_out, digit_test_meass, model);